Group Anagrams
Question
Given an array of strings, group anagrams together.
For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
Return:
|
|
Analysis
将每个字符串排序后的值作为key。假如当前的table中不存在该key,则插入key值和新建List;假如存在的话,直接插入get得到的List中。
Code
|
|
Super Pow
Question
Your task is to calculate a**b mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.
Example1:
|
|
Example2:
|
|
Analysis
https://discuss.leetcode.com/topic/50489/c-clean-and-short-solution/7
Code
|
|